<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str="abcdcba"
        var arr=str.split("")
        console.log(arr);

        var str1=arr.join()
        console.log(str1);
        
        var res = arr.reverse()
        console.log(res);

        var res1=res.join()
        if(str1===res1){
            alert("这个是回文字符串")
        }else{
            alert("这个不是回文字符串")
        }
    </script>
</body>
</html>